package com.calligraphy.order;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

//@SpringBootApplication
//@EnableDiscoveryClient
//@EnableCircuitBreaker
@EnableSwagger2     //http://localhost:8080/swagger-ui.html
@SpringCloudApplication
@EnableHystrixDashboard //可视化Hystrix
@EnableFeignClients(basePackages = "com.calligraphy.product.client")
@ComponentScan(basePackages = "com.calligraphy")
@Slf4j
@EnableCaching
public class OrderApplication {

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(OrderApplication.class, args);
        String serverPort = context.getEnvironment().getProperty("server.port");
        log.info("Order started at http://localhost:" + serverPort);
    }

}

